<template>
  <div
      v-for="(item, i) in list"
      :key="i"
  >
    <div  :class="[
            'right-menu-item',
            'level' + (item.level - minLevel),
            { active: item.slug === hashText }
          ]">
<!--      <a :href="item.link">{{ item.title }}  {{ item.level}}</a>-->
      <a :href="item.link">{{ item.title }}</a>
    </div>
    <RightMenuItem :list="item.children" :hashText="hashText" :minLevel="minLevel"></RightMenuItem>
  </div>
</template>

<script>
export default {
  name: "RightMenuItem",
  props:{
    list:{
      type: Array
    },
    hashText:{
      type: String
    },
    minLevel:{
      type: Number
    }
  },
  created() {
    // console.log(this.minLevel)
  }
}
</script>

<style scoped>

  .right-menu-item{
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    text-overflow: ellipsis;
    box-sizing: border-box;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 10px;
    position: relative;
  }
  .right-menu-item a{
    color: #00323c;
    opacity: 0.75;

  }
  .right-menu-item:hover a{
    color: #00323c;
    opacity: 1;
  }

  .active:before{
    content: '';
    position: absolute;
    top: 5px;
    left: 0;
    width: 3px;
    height: 14px;
    background: #11A8CD;
    border-radius: 0 4px 4px 0;
  }
  .active a{
    color: #11A8CD!important;
    opacity: 1;
  }

    .level1{
      padding-left: 20px;
     }
    .level2{
       padding-left: 35px;
     }
    .level3{
       padding-left: 45px;
     }
    .level4{
       padding-left: 65px;
     }
    .level5{
       padding-left: 75px;
     }

</style>
